package cn.sw.system.menu.controller;


import cn.sw.common.database.architecture.controller.BaseController;
import cn.sw.common.database.architecture.emun.BaseServiceOf;
import cn.sw.common.database.domain.dto.form.MenuFormDto;
import cn.sw.common.database.domain.dto.query.MenuQueryDto;
import cn.sw.common.database.domain.entity.Menu;
import cn.sw.common.database.domain.vo.vo.MenuVo;
import cn.sw.common.http.HttpResponse;
import cn.sw.system.menu.service.MenuService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
* 菜单表 前端控制器
* @author 张众森 (个人博客:https://)
* @date 2025-05-09
* @tags 做一个优秀的全栈架构
*/
@Api(tags = "Menu控制器")
@RestController
@RequestMapping("/menu")
@BaseServiceOf(Menu.class)
public class MenuController extends BaseController<Menu, MenuFormDto, MenuQueryDto, MenuVo> {

    @Resource
    private MenuService menuService;
    @PostMapping("/tree")
    public HttpResponse<?> tree(@RequestBody MenuQueryDto query) throws Exception {
        return menuService.tree(query);
    }

}
